#pragma once
#include "DataStream.h"

//binary serialization
namespace Serialize {

//给用户使用的序列化的函数
template <typename T>
void serialize(T data, const char* fileName)
{
    DataStream ds;
    ds.write(data);
    ds.save(fileName);
}

template <typename T>
void deserialize(T& data, const char* fileName)
{
    DataStream ds;
    ds.load(fileName);
    ds.read(data);
}

}

